package com.pengcheng.taskapplication.mvp.view.activity;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;

import com.pengcheng.taskapplication.R;
import com.pengcheng.taskapplication.helper.ImageLoader;
import com.pengcheng.taskapplication.model.BannerModel;
import com.zhouwei.mzbanner.holder.MZViewHolder;

public  class TopBannerViewHolder implements MZViewHolder<BannerModel> {
        private ImageView mImageView;
        @Override
        public View createView(Context context) {
            View view = LayoutInflater.from(context).inflate(R.layout.banner_item_layout,null);
            mImageView = (ImageView) view.findViewById(R.id.banner_img);
            return view;
        }

        @Override
        public void onBind(Context context, int i, BannerModel bannerModel) {
            Log.e("zhouwei","current position:"+i);
            ImageLoader.displayImage(context,bannerModel.getIcon(),mImageView);
            mImageView.setTag(bannerModel);
        }
    }